<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改车辆-信息')" />
    <th:block th:include="include :: bootstrap-fileinput-css" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-info-edit" th:object="${carInfo}">
            <input name="carInfoId" th:field="*{carInfoId}" type="hidden">
            <input name="carId" th:field="*{carId}" type="hidden">
            <input name="menuId" th:field="*{menuId}" type="hidden">
            <input name="configType" th:field="*{configType}" type="hidden">
            <input id="car_info" name="info" th:field="*{info}" type="hidden">
            <div class="form-group" th:if="${carInfo.carInfoId!=null}">
                <label class="col-sm-2 control-label">图片</label>
                <div class="col-sm-10" th:include="system/common/file_upload :: multiple_img(_file_id='multipleFile',_file_type='img',_file_list=${@file.getFiles(carInfo.carId,carInfo.configType)})"/>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">防抱死：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a1" th:field="*{infoMap.a1}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">制动分配：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a2" th:field="*{infoMap.a2}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">刹车辅助：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a3" th:field="*{infoMap.a3}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">牵引力控制（ASR/TCS/TRC)：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a4" th:field="*{infoMap.a4}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">车身稳定系统（ESP/ESC/DSC)：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a5" th:field="*{infoMap.a5}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">并线辅助：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a6" th:field="*{infoMap.a6}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">车道偏离预警：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a7" th:field="*{infoMap.a7}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">后方来车预警：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a8" th:field="*{infoMap.a8}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">车道保住辅助：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a9" th:field="*{infoMap.a9}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">道路交通标识识别：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a10" th:field="*{infoMap.a10}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">主动刹车：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a11" th:field="*{infoMap.a11}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">疲劳驾驶警示：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a12" th:field="*{infoMap.a12}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">整车安全气囊总数：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a13" th:field="*{infoMap.a13}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">主驾气囊：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a14" th:field="*{infoMap.a14}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">副驾气囊：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a15" th:field="*{infoMap.a15}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">副驾气囊位置：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a16" th:field="*{infoMap.a16}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">前排座椅侧气囊：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a17" th:field="*{infoMap.a17}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">前后头部侧气帘：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a18" th:field="*{infoMap.a18}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">膝部气囊（驾驶位）：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a19" th:field="*{infoMap.a19}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">膝部气囊（副驾位）：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a20" th:field="*{infoMap.a20}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">膝部气囊位置：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a21" th:field="*{infoMap.a21}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">后排座椅侧气囊：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a22" th:field="*{infoMap.a22}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">前排座椅侧气囊：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a23" th:field="*{infoMap.a23}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">前排气囊式安全带：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a24" th:field="*{infoMap.a24}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">被动行人保护：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a25" th:field="*{infoMap.a25}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">主驾安全预警形式：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a26" th:field="*{infoMap.a26}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">副驾安全预警形式：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a27" th:field="*{infoMap.a27}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">后排左安全预警形式：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a28" th:field="*{infoMap.a28}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">后排右安全预警形式：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a29" th:field="*{infoMap.a29}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">后排中间安全预警形式：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a30" th:field="*{infoMap.a30}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">第三排左安全预警形式：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a31" th:field="*{infoMap.a31}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">第三排右安全预警形式：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a32" th:field="*{infoMap.a32}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">第三排中间安全预警形式：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a33" th:field="*{infoMap.a33}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">后排ISOFIX儿童座椅接口：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a34" th:field="*{infoMap.a34}" class="form-control" type="text" />
                </div>
                <label class="col-sm-2 control-label">第三排ISOFIX儿童座椅接口：</label>
                <div class="col-sm-2">
                    <input name="infoMap.a35" th:field="*{infoMap.a35}" class="form-control" type="text" />
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label"></label>
                <div class="col-sm-8"><button type="button" class="btn btn-success" onclick="submitHandler()">上传</button></div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js" />
    <th:block th:include="include :: select2-js" />
    <th:block th:include="include :: bootstrap-select-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/car/info";
        $("#form-info-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                let json=$('#form-info-edit').serializeJson();
                console.log(json)
                $('#car_info').val(JSON.stringify(json.infoMap)||'{}');
                let serialize = $('#form-info-edit').serialize();
                console.log(serialize)
                // console.log(JSON.stringify($('#form-info-edit').serializeJson()))
                // return;
                $.operate.save(prefix + "/edit?_="+Math.random(), serialize);
            }
        }
        $(function (){
            multipleFile_manager.init({busId: [[${carInfo.carId}]], busType: [[${carInfo.configType}]], fileType: 'img'});
        });
    </script>
</body>
</html>